package com.micro.core.exception;

import javax.validation.ConstraintDeclarationException;

/**
 * @desc 文件上传异常验证
 * @author LevelCoder
 * @version V1.0.0
 * @email LevelCoder@126.com
 * @date 2019/7/19
 */
public class BizValidationException extends ConstraintDeclarationException {

    /** 异常信息 */
    private String responseMessage;

    /** 异常码*/
    private String responseCode;

    /**
     * 只传递错误信息
     * @param responseMessage
     */
    public BizValidationException(String responseMessage){
        super(responseMessage);
        this.responseMessage = responseMessage;
    }

    /**
     *  传递错误码和错误信息
     * @param responseCode
     * @param responseMessage
     */
    public BizValidationException(String responseCode, String responseMessage) {
        super( responseMessage );
        this.responseMessage = responseMessage;
        this.responseCode = responseCode;
    }

    public BizValidationException() {
        super();
    }

    public BizValidationException(String message, Throwable cause) {
        super( message, cause );
    }

    public BizValidationException(Throwable cause) {
        super( cause );
    }


    public String getResponseMessage() {
        return responseMessage;
    }

    public void setResponseMessage(String responseMessage) {
        this.responseMessage = responseMessage;
    }

    public String getResponseCode() {
        return responseCode;
    }

    public void setResponseCode(String responseCode) {
        this.responseCode = responseCode;
    }
}
